#pragma once

#include <iterator>
#include "TextFingerPrint.h"
#include "TextWindowIterator.h"

using namespace std;

class TextFingerPrintIterator : iterator<input_iterator_tag, TextFingerPrint>
{
protected:
	TextWindowIterator *input_iterator;
	TextFingerPrint *text_finger_print;
public:
	int r;				// Radix - this may be smaller than the alphabet size
	HashValue_t q;		// Modulo
	int m;				// Pattern length
	HashValue_t h;		// The H-parameter (r^(m-1) % q)
	HashValue_t fingerprint;

	TextFingerPrintIterator(TextWindowIterator *input, int radix, HashValue_t q);
	~TextFingerPrintIterator(void);

	TextFingerPrintIterator& operator++();
	TextFingerPrint& operator*();
	bool operator==(const TextFingerPrintIterator);
	bool operator!=(const TextFingerPrintIterator);

	static TextFingerPrintIterator end(TextWindowIterator *end_iterator);
};

